//
//  TransportCircleViewController.m
//  Logistics
//
//  Created by 华谕 on 2017/10/30.
//  Copyright © 2017年 HUYU. All rights reserved.
//

#import "TransportCircleViewController.h"
#import "TransportModel.h"
#import "CloseGoodsAddressViewController.h"
#import "TruckTypeViewController.h"
#import "HallScreeningViewController.h"
#import "TruckDetailsViewController.h"

static NSString *cellPath = @"TransportCircleCell";
@interface TransportCircleViewController ()<UITableViewDelegate,UITableViewDataSource>
{
    UIView *screeView;
    UILabel *startLab;
    UIView *showView;
}
@property (nonatomic, strong)UITableView *tableview;
@property (nonatomic, strong)NSMutableArray *allLineAry;
@property (nonatomic, assign)NSInteger page;
@property (nonatomic, strong)NSString *serveId;
@property (nonatomic, strong)NSString *serveName;
@property (nonatomic, strong)NSString *latitude;
@property (nonatomic, strong)NSString *lontude;
@property (nonatomic, strong)NSString *truckTypeId;
@property (nonatomic, strong)NSString *length;
@property (nonatomic, strong)NSString *baffle;
@property (nonatomic, strong)TransportModel *Phonemodel;
@property (nonatomic, strong)NSString *CallPhone;
@property (nonatomic, assign)NSInteger TruckType;
@property (nonatomic, assign)NSInteger lenthType;
@property (nonatomic, assign)NSInteger baffType;

@end

@implementation TransportCircleViewController

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    NSNotificationCenter * center = [NSNotificationCenter defaultCenter];
    [center addObserver:self selector:@selector(callPhonesNotifice:) name:@"callPhones" object:nil];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"callPhones" object:nil];
}


- (void)callPhonesNotifice:(NSNotification *)center
{
    NSString *timeStr = [center object];
    Student *stu = [Student studentWith:_Phonemodel.headImg name:_Phonemodel.linkman Phone:_Phonemodel.phone Times:timeStr];
    BOOL isInsert = [StudentFMDNManager addStudent:stu];
    
    if (isInsert) {
        NSLog(@"插入成功");
    } else {
        NSLog(@"插入失败");
    }
}


- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"附近货车";
    self.view.backgroundColor = BacksColor;
    self.navigationController.navigationBar.translucent = NO;
    _serveId = @"";
    _serveName = @"停车点";
    _truckTypeId = @"";
    _length = @"";
    _baffle = @"";
    _page = 0;
    _allLineAry = [NSMutableArray arrayWithCapacity:0];
    if ([[LTools cacheForKey:SERVER_latitude] isEqualToString:@""])
    {
        [LTools showMBProgressWithText:@"定位失败" addToView:self.view];
        return;
    }
    _latitude = [LTools cacheForKey:SERVER_latitude];
    _lontude = [LTools cacheForKey:SERVER_longitude];
    [self creatUI];
    [self requestNearLogistics];
}


- (void)creatUI
{
    
    self.tableview = [[UITableView alloc] initWithFrame:CGRectMake(0, 45*displaywidth, SCREEN_WIDTH, SCREEN_HEIGHT-STA_NAV_HEIGHT-TABBAR_HEIGHT-45*displaywidth) style:UITableViewStylePlain];
    _tableview.backgroundColor = BacksColor;
    _tableview.delegate = self;
    _tableview.dataSource = self;
    _tableview.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:_tableview];
    self.tableview.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadNewHeaderData)];
    self.tableview.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreFootData)];
    self.tableview.mj_footer.automaticallyHidden = YES;
    self.tableview.estimatedRowHeight = 0;
    self.tableview.estimatedSectionHeaderHeight = 0;
    self.tableview.estimatedSectionFooterHeight = 0;
    showView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    showView.backgroundColor = RGBA(0, 0, 0, 0.6);
    showView.hidden = YES;
    [sharedDelegate.window addSubview:showView];
    screeView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 45*displaywidth)];
    screeView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:screeView];
    [self creatScreeView];
    screeView.layer.shadowOpacity = 1;// 阴影透明度
    screeView.layer.shadowColor = RGB(187, 187, 187).CGColor;// 阴影的颜色
    screeView.layer.shadowOffset = CGSizeMake(1, 3);// 阴影的范围
}

- (void)loadNewHeaderData
{
    _page = 0;
    [self requestNearLogistics];
    
}

- (void)loadMoreFootData
{
    _page ++;
    [self requestNearLogistics];
    
}

- (void)creatScreeView
{
    NSArray *typeAry = @[@"停车点",@"车型车长"];
    CGFloat W = SCREEN_WIDTH/typeAry.count;
    for (int i = 0; i < typeAry.count; i++)
    {
        UILabel *nameLab = [ZCControl createLabelWithFrame:CGRectMake(15*displaywidth+W*i, 0, W-40*displaywidth, 45*displaywidth) Font:15.0 Text:typeAry[i] Color:RGB(53, 53, 53)];
        [screeView addSubview:nameLab];
        UIImageView *imgView = [ZCControl createImageViewWithFrame:CGRectMake(W-25*displaywidth+W*i, 17.5*displaywidth, 10*displaywidth, 10*displaywidth) ImageName:@"arrowicon"];
        imgView.contentMode = UIViewContentModeScaleAspectFit;
        [screeView addSubview:imgView];
        UIButton *btn = [ZCControl createButtonWithFrame:CGRectMake(W*i, 0, W, 45*displaywidth) ImageName:nil Target:self Action:@selector(closeRoursAction:) Title:nil Font:12.0];
        btn.backgroundColor = [UIColor clearColor];
        btn.tag = 100+i;
        [screeView addSubview:btn];
        if (i == 0)
        {
            startLab = nameLab;
        }
        if (i != 0)
        {
            UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(W*i, 12.5*displaywidth, 1, 20*displaywidth)];
            lineView.backgroundColor = RGB(235, 235, 235);
            [screeView addSubview:lineView];
        }
        
    }
}

- (void)closeRoursAction:(UIButton *)btn
{
    NSInteger index = btn.tag-100;
    WEAKSELF;
    if (index == 0)
    {
        //选择停车点
        CloseGoodsAddressViewController *vc = [[CloseGoodsAddressViewController alloc] init];
        vc.areaType = index;
        vc.isCar = YES;
        vc.closeBlock = ^(NSString *name, NSInteger index)
        {
            NSArray *nameAry = [name componentsSeparatedByString:@","];
            if (nameAry.count == 2)
            {
                _serveName = nameAry[0];
                _serveId = nameAry[1];
                startLab.text = _serveName;
            }
            
            [weakSelf loadNewHeaderData];
        };
        [self.navigationController pushViewController:vc animated:YES];
    }
    else
    {
        //车型车长
        HallScreeningViewController *vc = [[HallScreeningViewController alloc] init];
        vc.tagType = 0;
        vc.TruckType = _TruckType;
        vc.lenthType = _lenthType;
        vc.baffType = _baffType;
        vc.isTrans = YES;
        vc.closeBlock = ^(NSString *tagStr,NSString *truckId, NSString *lenthStr, NSString *baffStr,NSInteger tagid,NSInteger truck,NSInteger len,NSInteger baf)
        {
            weakSelf.truckTypeId = truckId;
            weakSelf.length = lenthStr;
            weakSelf.baffle = baffStr;
            weakSelf.TruckType = truck;
            weakSelf.lenthType = len;
            weakSelf.baffType = baf;
            [weakSelf loadNewHeaderData];
        };
        [self.navigationController pushViewController:vc animated:YES];
        
    }
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return _allLineAry.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    if (!cell)
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellPath];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.backgroundColor = [UIColor whiteColor];
    if (_allLineAry.count > 0)
    {
        UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 10*displaywidth)];
        lineView.backgroundColor = BacksColor;
        [cell.contentView addSubview:lineView];
        TransportModel *model = _allLineAry[indexPath.row];
        UIImageView *imgView = [ZCControl createImageViewWithFrame:CGRectMake(15*displaywidth, 20*displaywidth, 90*displaywidth, 60*displaywidth) ImageName:@"newsImage"];
        if (model.headImg > 0)
        {
            [imgView sd_setImageWithURL:[NSURL URLWithString:model.headImg] placeholderImage:[UIImage imageNamed:@"newsImage"]];
        }
        imgView.contentMode = UIViewContentModeScaleAspectFill;
        imgView.layer.masksToBounds = YES;
        [cell.contentView addSubview:imgView];
        NSString *busy = @"有空";
        UIColor *backCols = RGB(238, 78, 78);
        if ([model.busy integerValue] == 1)
        {
            busy = @"没空";
            backCols = BacksColor;
        }
        UILabel *typeLabel = [ZCControl createLabelWithFrame:CGRectMake(10*displaywidth, 15*displaywidth, 20*displaywidth, 20*displaywidth) Font:8.0 Text:busy Color:[UIColor whiteColor]];
        typeLabel.textAlignment = NSTextAlignmentCenter;
        typeLabel.backgroundColor = backCols;
        typeLabel.layer.cornerRadius = 10*displaywidth;
        typeLabel.layer.masksToBounds = YES;
        [cell.contentView addSubview:typeLabel];
        
        UILabel *comNameLab = [ZCControl createLabelWithFrame:CGRectMake(115*displaywidth, 20*displaywidth, SCREEN_WIDTH-190*displaywidth, 20*displaywidth) Font:15.0 Text:model.linkman Color:BlaTitColor];
        comNameLab.textAlignment = NSTextAlignmentLeft;
        [cell.contentView addSubview:comNameLab];
        CGRect bounds = [comNameLab.text boundingRectWithSize:CGSizeMake(500*displaywidth, 20*displaywidth) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObject:NormalFontWithSize(15.0+fontScale) forKey:NSFontAttributeName] context:nil];
        CGFloat widrh = bounds.size.width+10*displaywidth;
        if (widrh > SCREEN_WIDTH-190*displaywidth)
        {
            widrh = SCREEN_WIDTH-190*displaywidth;
        }
        comNameLab.frame = CGRectMake(115*displaywidth, 20*displaywidth, widrh, 20*displaywidth);
        widrh+=115*displaywidth;
        if ([model.shi integerValue] == 1)
        {
            UILabel *shiLab = [ZCControl createLabelWithFrame:CGRectMake(widrh, 22.5*displaywidth, 15*displaywidth, 15*displaywidth) Font:10.0 Text:@"实" Color:[UIColor whiteColor]];
            shiLab.textAlignment = NSTextAlignmentCenter;
            shiLab.backgroundColor = RGB(204, 153, 102);
            [cell.contentView addSubview:shiLab];
        }
        
        NSString *lenStr = @"";
        if (![model.length isEqualToString:@""])
        {
            lenStr = string(model.length, @"米");
        }
        if (![model.truckType isEqualToString:@""])
        {
            lenStr = [lenStr stringByAppendingString:[NSString stringWithFormat:@"/%@",model.truckType]];
        }
        if ([model.baffle integerValue] == 1)
        {
            lenStr = [lenStr stringByAppendingString:@"/有尾板"];
        }
        if ([model.baffle integerValue] == 0)
        {
            lenStr = [lenStr stringByAppendingString:@"/无尾板"];
        }
        UILabel *lentnLab = [ZCControl createLabelWithFrame:CGRectMake(115*displaywidth, 40*displaywidth, SCREEN_WIDTH-170*displaywidth, 20*displaywidth) Font:13.0 Text:lenStr Color:ThemeColor];
        [cell.contentView addSubview:lentnLab];
        
        UIButton *callBtn = [ZCControl createButtonWithFrame:CGRectMake(SCREEN_WIDTH-45*displaywidth, 25*displaywidth, 30*displaywidth, 30*displaywidth) ImageName:@"bigtel" Target:self Action:@selector(callPhoneAction:) Title:nil Font:12.0];
        callBtn.tag = indexPath.row + 1000;
        [cell.contentView addSubview:callBtn];
        UILabel *addressLab = [ZCControl createLabelWithFrame:CGRectMake(115*displaywidth, 60*displaywidth, SCREEN_WIDTH-190*displaywidth, 20*displaywidth) Font:10.0 Text:model.parkStation Color:RGB(154, 154, 154)];
        addressLab.textAlignment = NSTextAlignmentLeft;
        [cell.contentView addSubview:addressLab];
        CGFloat distance = [model.distance floatValue]/1000.0;
        NSString *string = [NSString stringWithFormat:@"%.1lfkm",distance];
        if (distance == 0)
        {
            string = @"0km";
        }
        UILabel *distanceLab = [ZCControl createLabelWithFrame:CGRectMake(SCREEN_WIDTH-70*displaywidth, 60*displaywidth, 70*displaywidth, 20*displaywidth) Font:10.0 Text:string Color:RGB(154, 154, 154)];
        distanceLab.textAlignment = NSTextAlignmentCenter;
        [cell.contentView addSubview:distanceLab];
        NSString *timeString = [self timeIntervalFromLastTime:model.truckLine.returnDtm lastTimeFormat:@"yyyy-MM-dd HH:mm:ss"];
        if (![timeString isEqualToString:@"已过期"])
        {
            UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, 90*displaywidth, SCREEN_WIDTH, 25*displaywidth)];
            bottomView.backgroundColor = RGB(232, 236, 244);
            [cell.contentView addSubview:bottomView];
            CGFloat W = 0;
            UILabel *startAddressLab = [ZCControl createLabelWithFrame:CGRectMake(15*displaywidth, 0, 145*displaywidth, 25*displaywidth) Font:11.0 Text:[NSString stringWithFormat:@"%@%@",model.truckLine.shipmentDistrict,model.truckLine.shipmentName] Color:ThemeColor];
            CGRect bound1 = [startLab.text boundingRectWithSize:CGSizeMake(SCREEN_WIDTH, 25*displaywidth) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObject:NormalFontWithSize(11.0+fontScale) forKey:NSFontAttributeName] context:nil];
            startAddressLab.frame = CGRectMake(15*displaywidth, 0, bound1.size.width+5*displaywidth, 25*displaywidth);
            W += (bound1.size.width+20*displaywidth);
            [bottomView addSubview:startAddressLab];
            UIImageView *imgBView = [ZCControl createImageViewWithFrame:CGRectMake(W, 5*displaywidth, 30*displaywidth, 15*displaywidth) ImageName:@"lb_icon20"];
            imgBView.contentMode = UIViewContentModeScaleAspectFit;
            [bottomView addSubview:imgBView];
            W+=35*displaywidth;
            UILabel *stopLab = [ZCControl createLabelWithFrame:CGRectMake(W, 0, SCREEN_WIDTH-W-50*displaywidth, 25*displaywidth) Font:11.0 Text:[NSString stringWithFormat:@"%@%@",model.truckLine.destinationDistrict,model.truckLine.destinationName] Color:ThemeColor];
            [bottomView addSubview:stopLab];
            UILabel *timeLab = [ZCControl createLabelWithFrame:CGRectMake(SCREEN_WIDTH-180*displaywidth, 0, 165*displaywidth, 25*displaywidth) Font:10.0 Text:timeString Color:ThemeColor];
            timeLab.textAlignment = NSTextAlignmentRight;
            [bottomView addSubview:timeLab];
        }
    }
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    TransportModel *model = _allLineAry[indexPath.row];
    TruckDetailsViewController *vc = [[TruckDetailsViewController alloc] init];
    vc.carID = s_str(model.ID);
    vc.distance = model.distance;
    [self.navigationController pushViewController:vc animated:YES];
}

- (void)callPhoneAction:(UIButton *)btn
{
    NSInteger index = btn.tag-1000;
    TransportModel *model = _allLineAry[index];
    showView.hidden = NO;
    [self creatShowView:model];
    
}

- (void)creatShowView:(TransportModel *)model
{
    for (id v in showView.subviews)
    {
        [v removeFromSuperview];
    }
    NSString *phone = model.phone;
    UIView *whiteView = [[UIView alloc] initWithFrame:CGRectMake(40*displaywidth, SCREEN_HEIGHT/2-100*displaywidth, SCREEN_WIDTH-80*displaywidth, 185*displaywidth)];
    whiteView.backgroundColor = [UIColor whiteColor];
    whiteView.layer.cornerRadius = 10;
    whiteView.layer.masksToBounds = YES;
    [showView addSubview:whiteView];
    UIView *topView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-80*displaywidth, 85*displaywidth)];
    topView.backgroundColor = ThemeColor;
    [whiteView addSubview:topView];
    UIButton *closeBtn = [ZCControl createButtonWithFrame:CGRectMake(SCREEN_WIDTH-120*displaywidth, 10*displaywidth, 25*displaywidth, 25*displaywidth) ImageName:@"closeicon" Target:self Action:@selector(closeViewAction) Title:nil Font:12.0];
    [topView addSubview:closeBtn];
    UILabel *tostLab = [ZCControl createLabelWithFrame:CGRectMake(0, 45*displaywidth, SCREEN_WIDTH-80*displaywidth, 30*displaywidth) Font:14.0 Text:@"联系时，请说明信息来自专线网" Color:RGB(218,222,232)];
    tostLab.textAlignment = NSTextAlignmentCenter;
    [topView addSubview:tostLab];
    CGFloat H = 85*displaywidth;
    if (phone.length > 0)
    {
        UIButton *btn = [ZCControl createButtonWithFrame:CGRectMake(0, H, SCREEN_WIDTH-80*displaywidth, 49*displaywidth) ImageName:nil Target:self Action:@selector(callphone:) Title:model.linkman Font:15.0];
        objc_setAssociatedObject(btn, "firstObject", model, OBJC_ASSOCIATION_RETAIN_NONATOMIC);   //实际上就是KVC
        objc_setAssociatedObject(btn, "secondObject", phone, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
        [btn setTitleColor:ThemeColor forState:UIControlStateNormal];
        [whiteView addSubview:btn];
        H = 135*displaywidth;
    }
    
    whiteView.frame = CGRectMake(40*displaywidth, SCREEN_HEIGHT/2-100*displaywidth, SCREEN_WIDTH-80*displaywidth, H);
    
}

- (void)closeViewAction
{
    showView.hidden = YES;
    
}

- (void)callphone:(UIButton *)btn
{
    showView.hidden = YES;
    _Phonemodel = objc_getAssociatedObject(btn, "firstObject");
    NSString *phone = objc_getAssociatedObject(btn, "secondObject");
    _CallPhone = phone;
    [[UIApplication sharedApplication]openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@",phone]]];
    
}



- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    TransportModel *model = _allLineAry[indexPath.row];
    NSString *timeString = [self timeIntervalFromLastTime:model.truckLine.returnDtm lastTimeFormat:@"yyyy-MM-dd HH:mm:ss"];
    if (![timeString isEqualToString:@"已过期"])
    {
        return 115*displaywidth;
    }
    return 90*displaywidth;
}

- (void)requestNearLogistics
{
    WEAKSELF;
    NSDictionary *dic = @{ @"lng":_lontude,
                           @"page":s_Integer(_page),
                           @"size":@"10",
                           @"areaId":_serveId,
                           @"lat":_latitude,
                           @"truckTypeId":_truckTypeId,
                           @"length":_length,
                           @"baffle":_baffle};
    [HYBaseHandler requestWithTheFormUrl:SERVER_truckList Parmers:dic Success:^(id obj) {
        [weakSelf.tableview.mj_header endRefreshing];
        [weakSelf.tableview.mj_footer endRefreshing];
        if ([obj server_Getcodecheck])
        {
            NSArray *lineAry = [TransportModel mj_objectArrayWithKeyValuesArray:obj[@"data"][@"content"]];
            dispatch_async(dispatch_get_main_queue(), ^{
                if (_page == 0)
                {
                    [weakSelf.allLineAry removeAllObjects];
                }
                [weakSelf.allLineAry addObjectsFromArray:lineAry];
                [weakSelf.tableview reloadData];
            });
        }
        else
        {
            [LTools showMBProgressWithText:obj[@"msg"] addToView:weakSelf.view];
        }
    } failed:^(NSError *error) {
        [weakSelf.tableview.mj_header endRefreshing];
        [weakSelf.tableview.mj_footer endRefreshing];
    }];
}

- (NSString *)timeIntervalFromLastTime:(NSString *)lastTime lastTimeFormat:(NSString *)format1
{
    //上次时间
    NSDateFormatter *dateFormatter1 = [[NSDateFormatter alloc]init];
    dateFormatter1.dateFormat = format1;
    NSDate *lastDate = [dateFormatter1 dateFromString:lastTime];
    //当前时间
    //    NSDateFormatter *dateFormatter2 = [[NSDateFormatter alloc]init];
    //    dateFormatter2.dateFormat = @"yyyy/MM/dd HH:mm:ss";
    //    NSDate *currentDate = [dateFormatter2 dateFromString:currentTime];
    return [self timeIntervalFromLastTime:lastDate ToCurrentTime:[NSDate date]];
    
}
- (NSString *)timeIntervalFromLastTime:(NSDate *)lastTime ToCurrentTime:(NSDate *)currentTime
{
    NSTimeZone *timeZone = [NSTimeZone systemTimeZone];
    //上次时间
    NSDate *lastDate = [lastTime dateByAddingTimeInterval:[timeZone secondsFromGMTForDate:lastTime]];
    //当前时间
    NSDate *currentDate = [currentTime dateByAddingTimeInterval:[timeZone secondsFromGMTForDate:currentTime]];
    //时间间隔
    NSInteger intevalTime = [lastDate timeIntervalSinceReferenceDate] - [currentDate timeIntervalSinceReferenceDate];
    
    //秒、分、小时、天、月、年
    NSInteger minutes = intevalTime / 60;
    NSInteger hours = intevalTime / 60 / 60;
    NSInteger day = intevalTime / 60 / 60 / 24;
    NSInteger month = intevalTime / 60 / 60 / 24 / 30;
    NSInteger yers = intevalTime / 60 / 60 / 24 / 365;
    if (minutes <= 0)
    {
        return @"已过期";
    }
    if (minutes < 60)
    {
        return  [NSString stringWithFormat:@"倒计时：0天0时%ld分",minutes];
    }
    else if (hours < 24)
    {
        minutes = minutes%60;
        return  [NSString stringWithFormat:@"倒计时：0天%ld时%ld分",hours,minutes];
    }else if (day >= 1)
    {
        hours = hours%24;
        minutes = minutes%60;
        return  [NSString stringWithFormat:@"倒计时：%ld天%ld时%ld分",day,hours,minutes];
    }
    return @"";
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
